1. Field of the Invention
The present invention relates to a technique for creating resource files which may be readily utilized by Internet compatible software applications. More particularly, the present invention relates to a technique for converting resource files into object oriented classes which may be utilized by software applications which exploit the Internet.
2. Description of the Related Art
Computer programs include logic and data portions. One type of data is known as resources. Resources include icons, cursors, menus, dialog boxes, audio clips, animation clips, film clips, etc. Thus, in today""s graphical and multimedia intensive programs, resources are vital portions of programs.
However, resources do not reside in a programs normal data segment. Thus, resources and resource files, in which resources are typically contained, are treated separately and differently from other types of data. For example, when the Windows operating system loads programs into memory for execution, such as those written in the C or C++ programming languages, it usually leaves the resources on the disk. Windows is a trademark of Microsoft Corporation. Typically, only when the Windows operating system needs a particular resource during execution of the program does it load the resource into memory.
Some object oriented languages treat resource files somewhat differently. For example, Smalltalk and ScriptX turn resources that will be utilized by an application or program into data objects, but then place these data objects into an object pool or resource pool for use by the application as necessary. Thus, resource data objects have still not obtained the status of a xe2x80x9cclassxe2x80x9d, and are and must be treated differently than regular object oriented classes in both Smalltalk and ScriptX.
This state of the art presents particular problems for applications that are to be used in conjunction with the Internet. The Java programming language is an object oriented language which has been optimized for the Internet. Java is a trademark of Sun Microsystems, Inc. Java classes may be easily used over the Internet, with security being provided relative to the classes as they are used via the Internet. Additionally, Java classes are packaged such that they may be compressed for sending over the Internet. This speeds up the transfer of data and enhances performance. However, resource data utilized by Java programs are still maintained in the same resource file format as utilized by languages such as C and C++. Accordingly, the security checking and compression techniques which are advantageous for Java classes are not applicable to resource files as utilized by Java programs per the present state of the art.
In order to appropriately support resource files, programming languages must have built-in thereto an appropriate support structure. The resource files support structure enables an application to access the data from the resource file during execution of the application at run-time. Obviously, if the need to rely on separate resource files were to be eliminated, a number of advantages would occur. First, it would not be necessary to build the necessary support structure for resource files into the programming language. Thus, special techniques for dealing with resource files would not have to be learned by developers or included in the program development environment. Additionally, with respect to Java, elimination of separate resource files and the inclusion of that information in Java language programs themselves as classes would enhance the security of the overall system, as the classes would be checked by the Java security implementation, and permit the resource files to be seamlessly compressed in accordance with accepted techniques for Java classes.
Accordingly, a need exists for a technique for permitting enhanced handling of data usually maintained in resource files while reducing complexity.
An object of the present invention is to provide a technique for converting resource files into object oriented classes.
Another object of the invention is to convert and compile resource files into Java source code and classes in order to gain the advantages available for manipulating Java classes in relation to the Internet.
Yet another object of the invention is to provide a technique for eliminating special support structures required in programming languages to deal with resource files at run-time.
Other objects and advantages of the present invention will be set forth in part in the description and the drawings which follow, and, in part, will be obvious from the description or may be learned by practice of the invention.
To achieve the forgoing object, and in accordance with the purpose of the invention as broadly described herein, the present invention provides computer readable code on media for converting a resource file into object oriented source code for a target object oriented language, comprising first subprocesses for converting a resource file filename to a class name acceptable by the target object oriented language; second subprocesses for converting information associated with each keyword into a format utilizable by a class in the target object oriented language; and third subprocesses for providing additional formatting code necessary for a class in the target object oriented language. The computer readable code may further comprise a compiler for compiling output of the first, second, and third subprocesses and it is preferred that the target object oriented language is Java.
The present invention also provides computer readable code for converting a resource file into source code for a target object oriented language class, comprising a plurality of subprocesses, one for each different keyword included the resource file, for converting data associated with the keyword into a form usable by a class in the target object oriented language; a first process for converting a resource filename into an acceptable class name; a second process for converting data associated with each keyword into code usable by the target object oriented language utilizing the subprocess corresponding to each keyword for each keyword in the resource file; and a third process for writing formal code required for a class in the target object oriented language.
Preferably, the target object oriented language is Java and the formal code written by the third process includes Java epilogue code and Java constructor code. The computer readable code may further comprise a fourth process for compiling output of the first, second and third processes into a Java class.
The present invention will now be described with reference to the following drawings, in which like reference numbers denote the same element throughout.